#pragma once

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

#include <errno.h>

#define __packed __attribute__((packed))

#define BIT(n) (1ull << (n))

#define __unlikely(cond) __builtin_expect(!!(cond), 0)
#define __likely(cond) __builtin_expect(!!(cond), 1)

#define __early_panic(i, j) __asm__ volatile("movq %0, %%rcx; movq %1, %%rdx; movq $0x0d000721, %%rax;int $1" ::"r"((uint64_t)i), "r"((uint64_t)j) : "memory")

#define incbin_sizeof(name) ((size_t)((uint8_t *)&__end_##name - (uint8_t *)&__##name))
#define incbin_extern(name) extern char __##name, __end_##name

typedef int64_t status_t;

typedef unsigned short char16_t;
typedef unsigned int char32_t;